@import "open-color/open-color.scss";

@mixin isMobile() {
  @at-root .drawnix--mobile#{&} {
    @content;
  }
}

@mixin toolbarButtonColorStates {
  &.fillable {
    .tool-icon_type_radio,
    .tool-icon_type_checkbox {
      &:checked + .tool-icon__icon {
        --icon-fill-color: var(--color-on-primary-container);

        svg {
          fill: var(--icon-fill-color);
        }
      }
    }
  }

  .tool-icon_type_radio,
  .tool-icon_type_checkbox {
    &:checked + .tool-icon__icon {
      background: var(--color-surface-primary-container);
      --keybinding-color: var(--color-on-primary-container);

      svg {
        color: var(--color-on-primary-container);
      }
    }
  }

  .tool-icon__keybinding {
    bottom: 4px;
    right: 4px;
  }

  .tool-icon__icon {
    &:hover {
      background-color: var(--color-surface-primary-container);
      color: var(--color-primary);
    }

    &:active {
      background-color: var(--color-surface-primary-container);
      border: 1px solid var(--button-active-border);

      svg {
        color: var(--color-on-primary-container);
      }
    }

    &[aria-disabled="true"] {
      background: initial;
      border: none;

      svg {
        color: var(--color-disabled);
      }
    }
  }
}

@mixin outlineButtonStyles {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.625rem;
  width: var(--button-width, var(--default-button-size));
  height: var(--button-height, var(--default-button-size));
  box-sizing: border-box;
  border: none;
  border-style: none;
  border-color: var(--button-border, var(--default-border-color));
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  background-color: var(--button-bg, var(--island-bg-color));
  color: var(--icon-fill-color);
  font-family: var(--ui-font);

  svg {
    width: var(--button-width, var(--lg-icon-size));
    height: var(--button-height, var(--lg-icon-size));
  }

  &:hover {
    background-color: var(--button-hover-bg, var(--island-bg-color));
    border-color: var(
      --button-hover-border,
      var(--button-border, var(--default-border-color))
    );
  }

  &:active {
    background-color: var(--button-active-bg, var(--island-bg-color));
    border-color: var(--button-active-border, var(--color-primary-darkest));
  }

  &.active {
    background-color: var(
      --button-selected-bg,
      var(--color-surface-primary-container)
    );
    border-color: var(
      --button-selected-border,
      var(--color-surface-primary-container)
    );

    &:hover {
      background-color: var(
        --button-selected-hover-bg,
        var(--color-surface-primary-container)
      );
    }

    svg {
      color: var(--button-color, var(--color-on-primary-container));
    }
  }
}

$theme-filter: "invert(93%) hue-rotate(180deg)";
$right-sidebar-width: "302px";

:export {
  themeFilter: unquote($theme-filter);
  rightSidebarWidth: unquote($right-sidebar-width);
}
